import Router from 'koa-router';
import DeviceStatsController from '../controller/DeviceStats.Controller';
const router = new Router({prefix: "/device"});
const deviceStatsController = new DeviceStatsController();

// 获取所有设备统计信息
router.get('/', deviceStatsController.getDeviceStatistics); 

// 获取指定设备状态
router.get('/:deviceId', deviceStatsController.getDeviceStatus);

// 重置设备掉线计数
router.post('/:deviceId/reset-offline-count', deviceStatsController.resetDeviceOfflineCount);

// 获取在线设备列表
router.get('/status/online', deviceStatsController.getOnlineDevices);

// 获取离线设备列表
router.get('/status/offline', deviceStatsController.getOfflineDevices);

// 获取设备掉线排行榜
router.get('/ranking/offline', deviceStatsController.getDeviceOfflineRanking);


export default router;